home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PsL Monthly 1993 December
/
PSL Monthly Shareware CD-ROM (December 1993).iso
/
prgmming
/
dos
/
asm
/
ibmasm.doc
< prev
next >
Wrap
Text File
|
1985-01-07
|
11KB
|
291 lines
1: Sample Assembler Programs 11-11-1983 IBM
At this time there are two sample programs in assembler available for
downloading. They are INTRPT.ASM and VDISK.ASM. The first is used by
the Pascal program SAMPLES.PAS to execute DOS interrupts. It shows how
to establish the linkage from Pascal to Assembler.
The second is the sample device driver from the DOS 2.00 manual. It
creates a 180KB virtual diskette drive in memory.
To get either program, use the <F>iles command.
The next message is:
2: Processing Tab Characters 05-08-1984 ROBERT BECKLEY
<R>ead, <N>ext, or <Q>uit? R
(This message was re-printed from the May issue of EXCHANGE)
Robert H. Beckley
Manassas Personal Computer Club
Some editors, like the Personal Editor, compress blanks out of text
files before storing those files onto the diskette. This helps shorten
the files and thus provide more free diskette space. However, it adds
an additional burden to any program that wants to process the files. In
working on my own word processor, BEEPER, I added an assembly language
routine that would expand the tabs back to the original blanks. I will
share that Assembly Language program and a sample Pascal test program
with you here.
A tab character is a special ASCII code that is inserted in a file to
replace up to eight blanks. The tabs are set for columns 8, 16, 24, and
so forth. If there are more than eight blanks in a row, multiple tab
characters may be inserted into the text. The algorithm for determining
the number of blanks to insert to expand the tab is:
Number of blanks to insert =
MORE...<C>ontinue or <Q>uit?RPlease strike one of these letters: <C>, <Q>.
8 - (COL mod 8)
Examples:
If tab char is in col 1, then insert 7 blanks
If tab char is in col 2, then insert 6 blanks
If tab char is in col 7, then insert 1 blank
If tab char is in col 10,then insert 6 blanks
The Assembly Language procedure that expands the tabs is shown on the
following page. It can be called from a Pascal program. Two parameters
are passed; both are variable length strings. The first is the original
line which may or may not include tabs, and the second is the resulting
string with tabs expanded to blanks. The second string must have enough
space for the maximum length line that can result. The program sets the
output string length to zero (a null string) if the input line is null
or is all blank. I did this because that is what I needed in BEEPER.
The program is documented, and I will leave it to the reader to learn it
from the listing.
The program can be assembled with the Macro Assembler, resulting in
object file that can be linked with the Pascal program which calls the
EXPAND_TABS routine. A test Pascal program illustrates that tab
expansion is provided. TEST shows how the Assembly Language is
referenced from Pascal. An attribute of EXTERN is attached to the
EXPAND_TABS procedure to allow the compiler to resolve calls to the
procedure. TEST can then be compiled to produce TEST.OBJ. TEST.OBJ can
be linked with the object produced by the Assembler to produce an
executable TEST.EXE file.
Assemble ENABLE.ASM --> ENABLE.OBJ
Compile TEST.PAS --> TEST.OBJ
Link LINK TEST+ENABLE; --> TEST.EXE
The TEST program assumes there is a file on the default drive called
TEST.TXT. This file should contain text containing tab characters
(e.g., a file stored under Personal Editor without invoking the NOTABS
option). The file is read, one line at a time, and each line is passed
to the EXPAND_TABS routine. The results are shown on the screen:
Length of the original string
The expanded original string
The original string with "@"
displayed for each tab char
======== Call EXPAND_TABS =======
Length of the resulting string
The resulting string
This shows the tabs in the original string by displaying them as "@"
characters. The resulting string, which shows that the tabs were
expanded properly, should be equal to the expanded original string
(which DOS has properly expanded to display it). The TEST can be used
to ensure that the above assemble and link steps where done correctly.
I hope this routine will be useful for the those who need to expand tabs
in text lines within a program.
[Download EXPNDTAB.ASM and TESTTAB.PAS.]
The next message is:
3: IBM Macro Assembler Version 2.00 08-14-1984 ANNOUNCEMENTS
<R>ead, <N>ext, or <Q>uit? C
Please strike one of these letters: <N>, <R>, <Q>.
<R>ead, <N>ext, or <Q>uit? R
The IBM Macro Assembler Version 2.00 is available for purchase as a
software product. It includes a non-macro (Small) and a macro assem-
bler to allow you to prepare programs for the IBM Personal Computer.
Additionally a Library Manager, Large Linker and a structured assem-
bler pre-processor are supplied with the Macro Assembler.
Assembler-produced programs may be called from Basic, Fortran, Pascal
and Cobol compiled programs. You may create an assembler language
program by using the text editing capability of DOS. Then use the
Macro Assembler to assemble the program.
Assembler-produced programs provide the ability to control the per-
sonal computer at a detailed level not available with other languages.
HIGHLIGHTS
__________
o Macro capability
o Supports full instruction set of the Personal Computer
o Supports 80286 (non-protect mode) instruction set
o Supports the 8087/80287 math co-processor
o Provides a Structured Assembler Pre-processor
o Provides a Library Manager
o Provides a Large Linker (up to 1MB)
o Provides 8087/80287 data format conversion routines
- To/from ASCII
- To/from the Microsoft data formats used by the IBM Personal
Computer Basic Interpreter, Basic Compiler/1.00, Fortran Com-
piler/1.00, and Pascal Compiler/1.00.
o Provides a cross-reference facility to aid in debugging
o Provides a set of pseudo operations to simplify coding
RELATIONSHIP TO PRIOR VERSION
_____________________________
The following enhancements are part of Version 2.00 relative to Ver-
sion 1.00.
o Support for the 80286 (non-protect mode) instruction set
o Support for the 8087/80287 math co-processor
o Data conversion routines
o Large Linker
o Library Manager
o Structured Assembler Pre-processor
o Maintenance and restriction removals
INSTALLATION/OPERATION
______________________
It is the user responsibility to install the Macro Assembler using the
guidelines provided in the Macro Assembler documentation.
Instructions for invoking the Macro Assembler and writing programs are
combined in the Macro Assembler documentation.
PACKAGING
_________
The assemblies and their related utilities are packaged on one
dual-sided eight-sector diskette. The diskette is packaged with the
Macro Assembler Reference manual.
The Macro Assembler modules can be placed on two single-sided disk-
ettes by copying the first 6 files onto the first diskette and the
remaining files onto the second diskette.
PUBLICATIONS
____________
This product is described in:
o The IBM Personal Computer Macro Assembler manual. (Two Volumes)
PREREQUISITES
_____________
The Macro Assembler requires DOS 1.1 or later. The Macro Assembler,
version 2.0, requires 96K of memory with DOS 1.1, or 128K with DOS 2.0
or higher. The Macro Assembler requires at least one double-sided
diskette drive. A printer and an 80-column display are recommended.
The Macro Assembler will operate on any IBM PCjr, IBM Personal Comput-
er, IBM Personal Computer XT, IBM Portable Personal Computer or IBM
Personal Computer AT wh